/**
 * Copyright &copy; 2018 thinkis All rights reserved.
 */
package com.thinkis.modules.sys.entity;

import com.thinkis.common.persistence.DataEntity;
import com.thinkis.modules.sys.utils.DictUtils;
import org.hibernate.validator.constraints.Length;

/**
 * 系统定时任务Entity
 * @author jauddy
 * @version 2019-07-05
 */
public class Schedule extends DataEntity<Schedule> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 任务名
	private String tGroup;		// 任务组
	private String expression;		// 定时规则
	private String status;		// 启用状态
	private String isInfo;		// 通知用户
	private String classname;		// 任务类
	private String description;		// 描述
	
	public Schedule() {
		super();
	}

	public Schedule(String id){
		super(id);
	}

	@Length(min=0, max=64, message="任务名长度必须介于 0 和 64 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=64, message="任务组长度必须介于 0 和 64 之间")
	public String getTGroup() {
		return tGroup;
	}

	public void setTGroup(String tGroup) {
		this.tGroup = tGroup;
	}
	
	@Length(min=0, max=64, message="定时规则长度必须介于 0 和 64 之间")
	public String getExpression() {
		return expression;
	}

	public void setExpression(String expression) {
		this.expression = expression;
	}
	
	@Length(min=0, max=64, message="启用状态长度必须介于 0 和 64 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@Length(min=0, max=64, message="通知用户长度必须介于 0 和 64 之间")
	public String getIsInfo() {
		return isInfo;
	}

	public void setIsInfo(String isInfo) {
		this.isInfo = isInfo;
	}
	
	@Length(min=0, max=256, message="任务类长度必须介于 0 和 256 之间")
	public String getClassname() {
		return classname;
	}

	public void setClassname(String classname) {
		this.classname = classname;
	}
	
	@Length(min=0, max=255, message="描述长度必须介于 0 和 255 之间")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getStatusLabel(){
        return DictUtils.getDictLabel(this.status, "yes_no", "");
    }
    public String getTGroupLabel(){
        return DictUtils.getDictLabel(this.status, "schedule_task_group", "");
    }
}